function v = getval(x)
  if(isa(x,'der1'))
    v = x.v;
  else
    v = x;
  end
